package com.charlotte.study.gupao.delegate.general;

import java.util.Random;

/**
 * @author junjie.ding
 * @date 2020/3/13
 */
public class Delegate implements Task {

    @Override
    public void doTask() {

        Task task = null;
        if(new Random().nextBoolean()){
            task = new ConcreteTaskA();
            task.doTask();
        }else{
            task = new ConcreteTaskB();
            task.doTask();
        }

    }
}
